﻿using HK.Core.Serializable;
using HK.Core.Serializable.Data;
using HK.Core.Serializable.Protocol.Data;
using HK.Editor.GUIEx.Protocol.Drawer;

namespace HK.Editor.Serializable.Protocol
{
    /// <summary>
    /// 接口 : 序列化资产文件编辑器
    /// </summary>
    /// <typeparam name="TAsset">资产文件类型</typeparam>
    public interface ISAssetEditor<out TAsset>
        where TAsset : SAsset
    {
        /// <summary>
        /// 序列化文件自身
        /// </summary>
        TAsset Self { get; }
        
        /// <summary>
        /// 编辑器模式下的序列化文件
        /// </summary>
        bool IsEditor { get; }
        
        /// <summary>
        /// 静态文件标志位
        /// </summary>
        bool IsStatic { get; }
        
        /// <summary>
        /// 资产文件路径
        /// </summary>
        string AssetPath { get; }
        
#region Header

        /// <summary>
        /// 头部绘制器
        /// </summary>
        ISAssetHeaderDrawer HeaderDrawer { get; }

#endregion
        
    }
    
    /// <summary>
    /// 接口 : 序列化资产文件编辑器
    /// </summary>
    /// <typeparam name="TAsset">序列化资产文件类型</typeparam>
    /// <typeparam name="TBody">数据Body类型</typeparam>
    public interface ISAssetEditor<out TAsset, out TBody> : ISAssetEditor<TAsset>
        where TAsset : SAsset, ISAsset<TBody>
        where TBody : SAssetData, new()
    {
        
        /// <summary>
        /// 序列化文件数据 - Body
        /// </summary>
        TBody Body { get; }
    }
}
